In video encoding represented by H.264/AVC (ISO/IEC 14496-10 “MPEG-4 Part 10 Advanced Video Coding”), intra encoding, in which encoding is performed on information in a frame using a correlation in a spatial direction, and inter encoding, in which encoding is performed on information between frames using a correlation in a temporal direction, are adaptively switched for use in response to the properties of an encoding target image, resulting in the improvement of compression efficiency. The inter encoding uses a motion-compensated technology, and searches for a motion vector indicating a position at which an encoding target region exists in a past or future frame called a reference frame, that is, the degree of movement of the encoding target region between the reference frame and an encoding target frame. In this case, it is possible to expect there to be a similar region in a position separated by the motion vector in the reference frame, and a difference value with the region to be significantly small. Using this, a differential signal with the reference frame is encoded, instead of a signal of the encoding target region, so that it is possible to improve encoding efficiency.
In a motion search process of obtaining the motion vector, a technique called block matching is extensively used. In the H.264/AVC, a rectangular block region obtained by dividing a screen is used as a unit of encoding. In a search range centering on the position of an encoding target block in the reference frame, an evaluation value such as a difference absolute value sum of pixels with the encoding target block is calculated, and a distance between a block pattern position having a minimum value and the position of the encoding target block is set as the motion vector. In the block matching, a technique called full search is used to calculate an evaluation value while shifting all block patterns in the search range of the reference range by one pixel.
However, a computation amount required in the block matching is significantly large as compared with other encoding processes. Particularly, when the block matching is applied to an encoding device for live video distribution in real time, it is necessary to reduce a computation amount of motion search. The computation amount of the motion search increases in proportion to the size of the search range. However, if the search range is simply uniformly narrowed in order to reduce the computation amount, when there is a region indicating a large motion, it is not possible to detect an appropriate motion vector, resulting in a problem that encoding efficiency is reduced.
Furthermore, in the inter encoding of the H.264/AVC, a plurality of encoding modes based on a change in a block size are permitted. A unit of an encoding target block is a rectangular block of 16×16 pixels called a macro block. The macro block is permitted to be divided into the following blocks.
(1) Using one motion vector in 16×16 blocks
(2) Using two motion vectors by dividing the macro block into two 16×8 blocks
(3) Using two motion vectors by dividing the macro block into two 8×16 blocks
(4) Dividing the macro block into four 8×8 blocks and permitting the following divisions (4-1) to (4-4) for respective 8×8 blocks
(4-1) Using one motion vector in 8×8 blocks
(4-2) Using two motion vectors by dividing the 8×8 blocks into two 8×4 blocks
(4-3) Using two motion vectors by dividing the 8×8 blocks into two 4×8 blocks
(4-4) Using four motion vectors by dividing the 8×8 blocks into four 4×4 blocks
In order to perform optimal encoding mode selection, it is necessary to detect a motion vector for all types of permitted block division. Moreover, as described above, since the H.264/AVC includes the intra encoding in addition to the inter encoding, it is necessary to perform the intra encoding to calculate a code amount and compare the code amount with a code amount by the inter encoding, in order to decide which of the inter encoding and the intra encoding is to be used. A load required for this mode selection also causes an increase in a computation amount in video encoding.
Conventionally, in order to reduce a load of the motion search, a motion amount is estimated for each region and the search range is appropriately narrowed for a region having a small motion, so that a computation amount is reduced. This method, for example, is effective in a video for which a camera is fixed as with a TV conference because a stationary region such as a background and a moving region are clearly distinguished from each other. A prior art of estimating a motion amount for each region and controlling a search range, for example, is disclosed in Patent Document 1. In Patent Document 1, based on a correlative evaluation result of an encoding target frame and a reference frame, a motion search range is reduced, so that a computation amount of motion search is suppressed.
However, in Patent Document 1, since a motion search range is limited without considering an amount of information on a motion vector, image quality may deteriorate. Furthermore, since a selection method of an inter mode and determination of the intra/inter encoding have not been described, an operation load due to the execution of encoding mode determination is not reduced.